package com.leyou.search.service;

import com.leyou.search.dto.SearchParamDTO;
import com.leyou.search.entity.Goods;
import com.leyou.starter.elastic.dto.PageInfo;
import reactor.core.publisher.Mono;

import java.util.List;

public interface SearchService {
    /**
     * 创建索引库并设置映射
     */
    void createIndexAndMapping();

    /**
     * 加载数据到索引库
     */
    void loadData();

    //查询自动补全数据
    Mono<List<String>> getSuggestion(String key);

    //分页查询商品数据
    Mono<PageInfo<Goods>> searchGoods(SearchParamDTO searchParamDTO);

    //新增商品到索引库
    void saveGoodsById(Long spuId);

    //根据id删除索引库里对应商品
    void deleteGoodsById(Long spuId);
}
